package com.example.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;

import java.nio.file.Path;
import java.nio.file.Paths;

@Configuration
public class StorageConfig {
    
    @Value("${audio.storage.location:audio-files}")
    private String storageLocation;

    @Bean
    public Path audioStoragePath() {
        Path path = Paths.get(storageLocation);
        if (!path.toFile().exists()) {
            path.toFile().mkdirs();
        }
        return path;
    }
} 